<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.w3.org/1999/xhtml">
<head >
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title>SOUQ ERP管理系统首页</title>
    <meta name="keywords" content="SOUQ ERP管理系统">
    <meta name="description" content="SOUQ ERP管理系统">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html"/>
    <![endif]-->
    <!--<link th:href="@{favicon.ico}" rel="stylesheet"/>-->
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/font-awesome.css}" rel="stylesheet"/>
    <link th:href="@{/css/animate.css}" rel="stylesheet"/>
    <link th:href="@{/css/style.css}" rel="stylesheet"/>
    <link th:href="@{/ruoyi/css/ry-ui.min.css?v=2.5.0}" rel="stylesheet"/>

    <style>
        ol, ul ,li{list-style:none}
        ul.imglist{ overflow:hidden}
        ul.imglist li{ float:left; padding:4px 8px; width:126px}
        ul.imglist li img{ display:block; width:110px; height:110px}
        ul.imglist li span{ display:block; width:100%; height:30px; line-height:30px; text-align:center
        }

        body{
            margin: 0;
            padding: 0;
            /*overflow:scroll;*/
            width: 100%;
        }

        .ibox-title{
            border-width: 4px 0 0;
        }
    </style>

<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5><font class="gjh" langKey="scanSendout">scan send out</font></h5>
                </div>
                <div class="ibox-content" >
                    <ul class="imglist" >
                        <li>
                            <a class="menuItemAsMain" shiro:hasPermission="module:awaitingAction:sweepCodeDelivery" onclick="sweepCodeDelivery('AwaitingAction 扫码发货')">
                                <div style="display:block; width:110px; height:110px;line-height: 110px">
                                    <img style="width:61px;height: 80px;margin-left: 23px;display: inline-block" th:src="@{/img/mainImg/awaitingSweepCodeDelivery.png}"/>
                                </div>
                                <span style="font-weight: bold">Awaiting Action</span>
                            </a>
                        </li>
                        <li >
                            <a class="menuItemAsMain" shiro:hasPermission="module:ordersDetail:sweepCodeDelivery" onclick="sweepCodeDelivery('ConfirmOrder 扫码发货')">
                                <div style="display:block; width:110px; height:110px;line-height: 110px">
                                    <img style="width:67px;height: 75px;margin-left: 23px;display: inline-block" th:src="@{/img/mainImg/confirmSweepCodeDelivery.png}"/>
                                </div>
                                <span style="font-weight: bold">Confirm Order</span>
                            </a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5 class="gjh" langKey="goodsLocation">the goods location</h5>
                </div>
                <div class="ibox-content" >
                    <ul class="imglist" >
                        <li>
                            <a class="menuItemAsMain" shiro:hasPermission="module:awaitingAction:sweepCodeDelivery" onclick="SweepCodeStockTaking('shelves 扫码上架')">
                                <div style="display:block; width:110px; height:110px;line-height: 110px">
                                    <img style="width:80px;height: 80px;margin-left: 23px;display: inline-block" th:src="@{/img/mainImg/sweepCodeLocation.png}"/>
                                </div>
                                <span style="font-weight: bold">scan putaway</span>
                            </a>
                        </li>
                        <li >
                            <a class="menuItemAsMain" shiro:hasPermission="module:ordersDetail:sweepCodeDelivery" onclick="sweepCodeDelivery('ConfirmOrder 扫码下架')">
                                <div style="display:block; width:110px; height:110px;line-height: 110px">
                                    <img style="width:80px;height: 80px;margin-left: 23px;display: inline-block" th:src="@{/img/mainImg/sweepCodeLocationX.png}"/>
                                </div>
                                <span style="font-weight: bold">scan sold out</span>
                            </a>
                        </li>
                        <li >
                            <a class="menuItemAsMain" shiro:hasPermission="module:ordersDetail:sweepCodeDelivery" onclick="sweepCodeDelivery('ConfirmOrder 扫码移货')">
                                <div style="display:block; width:110px; height:110px;line-height: 110px">
                                    <img style="width:80px;height: 80px;margin-left: 23px;display: inline-block" th:src="@{/img/mainImg/sweepCodeLocationY.png}"/>
                                </div>
                                <span style="font-weight: bold">scan move the goods</span>
                            </a>
                        </li>
                        <li >
                            <a class="menuItemAsMain" shiro:hasPermission="module:ordersDetail:sweepCodeDelivery" onclick="SweepCodeStockTaking('shelvesJ 捡货')">
                                <div style="display:block; width:110px; height:110px;line-height: 110px">
                                    <img style="width:80px;height: 80px;margin-left: 23px;display: inline-block" th:src="@{/img/mainImg/sweepCodeLocationJ.png}"/>
                                </div>
                                <span style="font-weight: bold">picking</span>
                            </a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="col-sm-3">
            <div class="ibox-content" style="border-width: 4px 0 0;text-align: center">
                <h2>Hello,Guest</h2>
                <small class="gjh" langKey="mobileScan">Mobile device access please scan the following qr code：</small>
                <br>
                <img th:src="@{/img/mainImg/QRCode.png}" style="max-width:150px;">
                <br>
            </div>
        </div>
    </div>
</div>
<div class="row  border-bottom white-bg dashboard-header" style="padding-top: 0px">
    <!--<hr style="margin-bottom: 0px">-->
    <div class="ibox-title" >
        <h5 >shortcut menu</h5>
    </div>
    <div style="padding: 0px 20px 10px 20px;border-style: solid solid none;border-color: #e7eaec;border-width: 1px 0px;">
        <ul class="imglist" id="side-menu" th:each="homepage:${homepages}">
            <li th:each="child:${homepage.child}">
                <a th:href="${child.url}" class="menuItemAsMain">
                    <img th:src="${child.imgUrl}">
                    <span th:text="${child.menuNameEnglish}"></span>
                </a>
            </li>
        </ul>
    </div>
</div>
 <div class="col-sm-12">
     <div class="ibox float-e-margins">
         <div class="ibox-title">
             <h5 >update log</h5>
         </div>
         <div class="ibox-content no-padding">
             <div class="panel-body">
                 <div class="panel-group" id="version">
                     <div class="panel panel-default">
                         <div class="panel-heading">
                             <h5 class="panel-title">
                                 <a data-toggle="collapse" data-parent="#version" href="#v06">v1.0.6</a><code class="pull-right">2018.11.02</code>
                             </h5>
                         </div>
                         <div id="v06" class="panel-collapse collapse">
                             <div class="panel-body">
                                 <ol>
                                     <li>1.修复了扫码发货格式问题</li>
                                     <li>2.修复订单全局搜索</li>
                                     <li>3.修复货物位置树的结构</li>
                                     <li>4.修复合计错误</li>
                                     <li>5.修改行点击</li>
                                     <li>6.修改海外仓签收的账号逻辑问题</li>
                                 </ol>
                             </div>
                         </div>
                     </div>
                     <div class="panel panel-default">
                         <div class="panel-heading">
                             <h5 class="panel-title">
                                 <a data-toggle="collapse" data-parent="#version" href="#v05">v1.0.5</a><code class="pull-right">2018.10.29</code>
                             </h5>
                         </div>
                         <div id="v05" class="panel-collapse collapse">
                             <div class="panel-body">
                                 <ol>
                                     <li>1.修复了部分货物名称过长导致的打印问题</li>
                                     <li>2.修复发往海外仓的合计问题</li>
                                     <li>3.修复发往海外仓生成编码的接口最大token问题</li>
                                     <li>4.修改每页最大加载数量为100</li>
                                     <li>5.修改扫码枪的扫码格式</li>
                                     <li>6.修改货物位置功能货架排序功能</li>
                                 </ol>
                             </div>
                         </div>
                     </div>
                     <div class="panel panel-default">
                         <div class="panel-heading">
                             <h5 class="panel-title">
                                 <a data-toggle="collapse" data-parent="#version" href="#v04">v1.0.4</a><code class="pull-right">2018.10.25</code>
                             </h5>
                         </div>
                         <div id="v04" class="panel-collapse collapse">
                             <div class="panel-body">
                                 <ol>
                                     <li>1.修改了选定的背景颜色样式</li>
                                     <li>2.修复了上传订单日期格式错误的问题</li>
                                     <li>3.修复了点击行样式其他按钮会触发背景颜色改变的问题</li>
                                     <li>4.修复了两个搜索功能之间的冲突问题（现在点击搜索会清楚快捷搜索框的内容）</li>
                                     <li>5.修复了扫码发货的错误</li>
                                 </ol>
                             </div>
                         </div>
                     </div>
                     <div class="panel panel-default">
                         <div class="panel-heading">
                             <h5 class="panel-title">
                                 <a data-toggle="collapse" data-parent="#version" href="#v03">v1.0.3</a><code class="pull-right">2018.10.19</code>
                             </h5>
                         </div>
                         <div id="v03" class="panel-collapse collapse">
                             <div class="panel-body">
                                 <ol>
                                     <li>1.新增了扫码发货的功能</li>
                                     <li>2.打印（包括批量）发货单下面添加了货物位置的信息</li>
                                     <li>3.当有其他用户正在打印面单/发货单您也能收到通知了</li>
                                 </ol>
                             </div>
                         </div>
                     </div>
                     <div class="panel panel-default">
                         <div class="panel-heading">
                             <h5 class="panel-title">
                                 <a data-toggle="collapse" data-parent="#version" href="#v02">v1.0.2</a><code class="pull-right">2018.10.11</code>
                             </h5>
                         </div>
                         <div id="v02" class="panel-collapse collapse">
                             <div class="panel-body">
                                 <ol>
                                     <li>1.修复fbs入库上传T单的问题。</li>
                                     <li>2.修复了转入fbs出库状态无效的问题。</li>
                                     <li>3.修复查询快递的接口问题。</li>
                                     <li>4.修改了产品管理下载模板。</li>
                                 </ol>
                             </div>
                         </div>
                     </div>
                     <div class="panel panel-default">
                         <div class="panel-heading">
                             <h5 class="panel-title">
                                 <a data-toggle="collapse" data-parent="#version" href="#v01">v1.0.1</a><code class="pull-right">2018.10.10</code>
                             </h5>
                         </div>
                         <div id="v01" class="panel-collapse collapse">
                             <div class="panel-body">
                                 <ol>
                                     <li>1.等待订单,确认订单添加扫码发货功能</li>
                                     <li>2.修复了商品批量上传图片的问题</li>
                                     <li>3.修改了海外仓要求的海签收的操作</li>
                                     <li>4.库存管理增加了商品ean查看权限</li>
                                     <li>5.部分细节调整优化</li>
                                 </ol>
                             </div>
                         </div>
                     </div>
                     <div class="panel panel-default">
                         <div class="panel-heading">
                             <h4 class="panel-title">
                                 <a data-toggle="collapse" data-parent="#version" href="#v00">v1.0.0</a><code class="pull-right">2018.10.01</code>
                             </h4>
                         </div>
                         <div id="v00" class="panel-collapse collapse">
                             <div class="panel-body">
                                 <ol>
                                     <li>SOUQ ERP管理后台正式发布。</li>
                                 </ol>
                             </div>
                         </div>
                     </div>
                 </div>
             </div>
         </div>
     </div>
 </div>

<div th:include="include :: footer"></div>
</body>


<script>

    $(".menuItemAsMain").each(function(index) {
        if (!$(this).attr('data-index')) {
            $(this).attr('data-index', index);
        }
    });

    function menuItemAsMain() {
        // 获取标识数据
        var dataUrl = $(this).attr('href'),
            dataIndex = $(this).data('index'),
            menuName = $.trim($(this).text()),
            flag = true;
        if (dataUrl == undefined || $.trim(dataUrl).length == 0) return false;

        // 选项卡菜单已存在
        $('.menuTab', parent.document).each(function() {
            if ($(this).data('id') == dataUrl) {
                if (!$(this).hasClass('active')) {
                    $(this).addClass('active').siblings('.menuTab', parent.document).removeClass('active');
                    scrollToTab(this);
                    // 显示tab对应的内容区
                    $('.mainContent .RuoYi_iframe', parent.document).each(function() {
                        if ($(this).data('id') == dataUrl) {
                            $(this).show().siblings('.RuoYi_iframe', parent.document).hide();
                            return false;
                        }
                    });
                }
                flag = false;
                return false;
            }
        });
        // 选项卡菜单不存在
        if (flag) {
            var str = '<a href="javascript:;" class="active menuTab" data-id="' + dataUrl + '">' + menuName + ' <i class="fa fa-times-circle"></i></a>';
            $('.menuTab', parent.document).removeClass('active');

            // 添加选项卡对应的iframe
            var str1 = '<iframe class="RuoYi_iframe" name="iframe' + dataIndex + '" width="100%" height="100%" src="' + dataUrl + '" frameborder="0" data-id="' + dataUrl + '" seamless></iframe>';
            // console.log($('.mainContent', parent.document).find('iframe.RuoYi_iframe').hide().parents('.mainContent'))
            $('.mainContent', parent.document).find('iframe.RuoYi_iframe').hide().parents('.mainContent').append(str1);

            $.modal.loading("The data is loading, please wait...");

            $('.mainContent iframe:visible', parent.document).load(function () {
                $.modal.closeLoading();
            });

            // 添加选项卡
            $('.menuTabs .page-tabs-content', parent.document).append(str);
            scrollToTab($('.menuTab.active', parent.document));
        }
        return false;
    }
    //计算元素集合的总宽度
    function calSumWidth(elements) {
        var width = 0;
        $(elements).each(function() {
            width += $(this).outerWidth(true);
        });
        return width;
    }

    //滚动到指定选项卡
    function scrollToTab(element) {
        var marginLeftVal = calSumWidth($(element).prevAll()),
            marginRightVal = calSumWidth($(element).nextAll());
        // 可视区域非tab宽度
        var tabOuterWidth = calSumWidth($(".content-tabs", parent.document).children().not(".menuTabs"));
        //可视区域tab宽度
        var visibleWidth = $(".content-tabs", parent.document).outerWidth(true) - tabOuterWidth;
        //实际滚动宽度
        var scrollVal = 0;
        if ($(".page-tabs-content", parent.document).outerWidth() < visibleWidth) {
            scrollVal = 0;
        } else if (marginRightVal <= (visibleWidth - $(element).outerWidth(true) - $(element).next().outerWidth(true))) {
            if ((visibleWidth - $(element).next().outerWidth(true)) > marginRightVal) {
                scrollVal = marginLeftVal;
                var tabElement = element;
                while ((scrollVal - $(tabElement).outerWidth()) > ($(".page-tabs-content", parent.document).outerWidth() - visibleWidth)) {
                    scrollVal -= $(tabElement).prev().outerWidth();
                    tabElement = $(tabElement).prev();
                }
            }
        } else if (marginLeftVal > (visibleWidth - $(element).outerWidth(true) - $(element).prev().outerWidth(true))) {
            scrollVal = marginLeftVal - $(element).prev().outerWidth(true);
        }
        $('.page-tabs-content', parent.document).animate({
                marginLeft: 0 - scrollVal + 'px'
            },
            "fast");
    }

    $('.menuItemAsMain').on('click', menuItemAsMain);


    //扫码发货弹出层
    function sweepCodeDelivery(title,url){
        var sign = title.split(" ");
        var url = "/module/ordersDetail/toSweepCodeDelivery?flag="+sign[0];
        $.modal.open("<h3 style='margin-top: 10px'>"+title+"</h3>", url,"",400);
        /*layer.open({
            type: 2,
            area: [250 + "px", 500+ "px"],
            fix: false,
            maxmin: true,
            shade: 0.3,
            title: '扫码发货',
            content: url,
            end: function () {
                // $.table.refresh();
            }
        })*/
    }

    //扫码上架弹出层
    function SweepCodeStockTaking(title,url){
        var prefix = ctx + "module/location"
        var sign = title.split(" ");
        var url = "";
        //扫码上架
        if (sign[0] == "shelves"){
            url = prefix+"/toSweepCodeLocation?flag="+sign[0];
            $.modal.open("<h3 style='margin-top: 10px'>"+sign[1]+"</h3>", url);
        }else if(sign[0] == "shelvesX"){
            url = prefix+"/toSweepCodeLocationX?flag="+sign[0];
            $.modal.open("<h3 style='margin-top: 10px'>"+sign[1]+"</h3>", url);
        }else if(sign[0] == "shelvesY"){
            url = prefix+"/toSweepCodeLocationY?flag="+sign[0];
            $.modal.open("<h3 style='margin-top: 10px'>"+sign[1]+"</h3>", url);
        }else if(sign[0] == "shelvesJ"){
            url = prefix+"/toSweepCodeLocationJ?flag="+sign[0];
            $.modal.open("<h3 style='margin-top: 10px'>"+sign[1]+"</h3>", url);
        }
    }
</script>
</html>
